package com.hzdesk.media.matvector.koreabatch.client.my_paperless.fragment.Fragment_view;

import android.animation.LayoutTransition;
import android.content.Intent;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.R;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.custom_view.MyRecyclerView;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.dialog.BottomAnimDateDialog;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.fragment.BaseFragment;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.fragment.Fragment_persenter.MeetingPersenter;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.fragment.fragment_contract.IMeetingContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.view.MettingListActivity;

/**
 * Created by Administrator on 2018/8/9.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class MeetingFragment extends BaseFragment implements IMeetingContract.IMeetingView,View.OnClickListener {

    private TextView tv_year;
    private TextView tv_few_metting;
    private TextView tv_file_number;
    private ImageView iv_data;
    private MyRecyclerView my_recylerview;
    private MeetingPersenter mMeetingPersenter = new MeetingPersenter(this);
    private LinearLayout ll_download_share_delect;
    private LinearLayout ll_download_metting_list;
    private LinearLayout ll_share_metting_list;
    private LinearLayout ll_delect_metting_list;

    @Override
    protected void initDate() {
        mMeetingPersenter.initTitle();
        mMeetingPersenter.initMyRecyclerview(my_recylerview,mContext);
    }
    @Override
    protected void cancellationControls() {
        if(tv_year != null){
            tv_year =null;
        }
        if(tv_few_metting != null){
            tv_few_metting = null;
        }
        if(iv_data != null){
            iv_data = null;
        }
        if(my_recylerview != null && ll_download_share_delect != null){
            my_recylerview = null;
            ll_download_share_delect = null;
        }
    }
    @Override
    protected View getChildFragmentView() {
        View view = View.inflate(mContext,R.layout.fragment_metting_list,null);
        findViewId(view);
        return view;
    }

    private void findViewId(View view) {
        tv_year = view.findViewById(R.id.fragment_metting_list_tv_year);
        tv_few_metting = view.findViewById(R.id.fragment_metting_list_tv_few_metting);
        tv_file_number = view.findViewById(R.id.fragment_metting_list_tv_file_number);
        iv_data = view.findViewById(R.id.fragment_metting_list_iv_data);
        my_recylerview = view.findViewById(R.id.activity_devices_unde_metting_my_recylerview);
        ll_download_share_delect = view.findViewById(R.id.fragment_metting_list_ll_download_share_delect);

        ll_download_metting_list = view.findViewById(R.id.fragment_metting_list_ll_download_metting_list);
        ll_share_metting_list = view.findViewById(R.id.fragment_metting_list_ll_share_metting_list);
        ll_delect_metting_list = view.findViewById(R.id.fragment_metting_list_ll_delect_metting_list);

        iv_data.setOnClickListener(this);
        ll_download_metting_list.setOnClickListener(this);
        ll_share_metting_list.setOnClickListener(this);
        ll_delect_metting_list.setOnClickListener(this);

    }

    @Override
    protected void onClickedTvRight() {

    }

    @Override
    protected void onClickedIvRight() {
        if(ll_download_share_delect.getVisibility() == View.VISIBLE){
            ll_download_share_delect.setVisibility(View.GONE);
        }else{
            ll_download_share_delect.setVisibility(View.VISIBLE);
        }
    }

    @Override
    protected void onClickedIvLeft() {

    }


    @Override
    public void setTitle() {
        showTileTitleRlBg();
        showTilteBg();
        showTitleContent();
        showTileIvRight();
        //设备管理(6)
        setTitleContent("我参加的会议", 0xffffffff);
        setIvLeftRight(R.mipmap.share_and_download);
    }

    @Override
    public void toMettingListPager() {
        startActivity(new Intent(mContext,MettingListActivity.class));
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.fragment_metting_list_iv_data:
                mMeetingPersenter.showDateDilaog(mContext);
                break;
            case R.id.fragment_metting_list_ll_download_metting_list:
                break;
            case R.id.fragment_metting_list_ll_share_metting_list:
                break;
            case R.id.fragment_metting_list_ll_delect_metting_list:
                break;
        }
    }
}
